# Maintainer: Krystian Chachuła <krystian@krystianch.com>
pkgname=py3-ly
_pkgname=python-ly
pkgver=0.9.8
pkgrel=1
pkgdesc="Tool and library for manipulating LilyPond files"
url="https://github.com/frescobaldi/python-ly"
arch="noarch"
license="GPL-2.0-or-later"
makedepends="py3-gpep517 py3-setuptools py3-wheel py3-sphinx"
subpackages="$pkgname-pyc $pkgname-doc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/frescobaldi/python-ly/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check" # tests are broken

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2

	sphinx-build -b man doc doc/build/man/
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl

	mkdir -p "$pkgdir"/usr/share/man/man1/

	install -m 644 doc/build/man/ly-server.1 doc/build/man/ly.1 \
		"$pkgdir"/usr/share/man/man1/
}

sha512sums="
28cf9a828a79ad473cb0429c3dd186d9028036bb6ab750aaf1d1299d1e4ac476262a4fcbcce0846fa4c851966d0e2dc9f263a7667613a5a2841ce0dd4c5b729a  python-ly-0.9.8.tar.gz
"
